package com.hl.toolkit.server.tycoin.account.slaverepository;

import com.tycoin.account.slaveentity.TycoinAccountPayment;
import com.tycoin.common.repository.AbstractRepository;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
@CacheConfig(cacheNames = "com.tycoin.account.slaverepository.tycoinAccountPaymentRepository")
public interface TycoinAccountPaymentRepository extends AbstractRepository<TycoinAccountPayment, Long> {
	
	
 	@Query(" select t from TycoinAccountRecharge t where t.paymentId = :paymentId  ")
	List<TycoinAccountPayment> FindPaymentId(@Param("paymentId") String PaymentId);

	TycoinAccountPayment findOneBypaymentId(String paymentId);



	@Query(" select t from TycoinAccountPayment t where t.userId = :userId  order by t.createTime DESC ")
	Page <TycoinAccountPayment> queryByPage(@Param("userId") Long userId, Pageable pageable);
	
	
 
 
}
